package com.work.tz.service.impl;

import com.work.tz.mapper.TaskTmplDelMapper;
import com.work.tz.model.TaskTmpl;
import com.work.tz.model.TaskTmplDel;
import com.work.tz.service.TaskDelService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;


@Service
public class TaskDelServiceImpl implements TaskDelService {

    @Autowired
    private TaskTmplDelMapper taskTmplDelMapper;

    @Override
    public void saveTaskDel(TaskTmpl task) {
        Long tmplId = task.getTmplId();
        int i = Integer.parseInt(tmplId.toString());
        List<TaskTmplDel> taskTmplDelList = task.getTaskTmplDelList();
        for (TaskTmplDel taskTmplDel : taskTmplDelList) {
            taskTmplDel.setTmplId(i);
        }
        taskTmplDelMapper.saveTaskDel(taskTmplDelList);

    }
}
